﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Style x:Key="MetroGridSplitter" TargetType="GridSplitter">
    <Setter Property="Background" Value="{DynamicResource GrayBrush7}" />
    <Setter Property="IsTabStop" Value="true" />
    <Setter Property="HorizontalAlignment" Value="Right" />
    <Setter Property="PreviewStyle">
      <Setter.Value>
        <Style TargetType="Control">
          <Setter Property="Background" Value="{DynamicResource GrayBrush7}" />
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="Control">
                <Grid x:Name="Root" Opacity=".5">

                  <!-- Background -->
                  <Rectangle Fill="{TemplateBinding Background}" />

                  <!-- Horizontal Template -->
                  <Grid x:Name="HorizontalTemplate" Height="6">
                    <!-- Just show the faint gray grid splitter rectangle with no other details -->
                  </Grid>

                  <!-- Vertical Template -->
                  <Grid x:Name="VerticalTemplate" Visibility="Collapsed" Width="6">
                    <!-- Just show the faint gray grid splitter rectangle with no other details -->
                  </Grid>

                </Grid>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="GridSplitter">
          <Grid x:Name="Root" IsHitTestVisible="{TemplateBinding IsEnabled}">

            <!-- VSM -->
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="MouseOver" />
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0" />
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Unfocused" />
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <!-- Background -->
            <Rectangle Fill="{TemplateBinding Background}" StrokeThickness="0" />

            <!-- Horizontal Template -->
            <Grid x:Name="HorizontalTemplate" Height="10">
              <StackPanel Height="6" VerticalAlignment="Center">
                <Rectangle Height="1" Margin="1" Width="10" StrokeThickness="0" Fill="{DynamicResource GrayBrush8}" />
                <Rectangle Height="1" Margin="1" Width="10" StrokeThickness="0" Fill="{DynamicResource GrayBrush8}" />
              </StackPanel>
            </Grid>

            <!-- Vertical Template -->
            <Grid x:Name="VerticalTemplate" Visibility="Collapsed" Width="10">
              <StackPanel Width="6" VerticalAlignment="Center" Orientation="Horizontal">
                <Rectangle Width="1" Margin="1" Height="10" StrokeThickness="0" Fill="{DynamicResource GrayBrush8}" />
                <Rectangle Width="1" Margin="1" Height="10" StrokeThickness="0" Fill="{DynamicResource GrayBrush8}" />
              </StackPanel>
            </Grid>

            <!-- Focus Visual -->
            <Rectangle x:Name="FocusVisual" Stroke="{DynamicResource GrayBrush7}" StrokeThickness="1" Opacity="0" IsHitTestVisible="false" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>